package com.xiguaji.tiktok.v1.ins.blogger.repository;

import com.xiguaji.tiktok.v1.ins.blogger.model.InsStBloggerFlBrandCategory;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

/**
 * 播主打点信息
 * @author Huangixn
 */
public interface InsStBloggerFlBrandCategoryRepository extends CrudRepository<InsStBloggerFlBrandCategory,Integer> {

    /**
     * 根据时间及uid 跃粉丝关注品牌类别统计表
     * @param uid
     * @param brandType
     * @param start
     * @param size
     * @return
     */
    @Query("select category_name,category_rate * 100 category_rate " +
            " from ins_st_blogger_fl_brand_category where uid = :uid and brand_type = :brandType " +
            " order by category_rank limit :start , :size ")
    List<InsStBloggerFlBrandCategory> findBrandCategoryByUid(long uid,int brandType,int start,int size);
}
